<fieldset>
    <legend>Cadastro de Permissões</legend>
    <div>
        <div class="maiscoluna" style="float: right;">
            <div id="dialog-confirm" title="Empty the recycle bin?"  >
                <p><span class="ui-icon ui-icon-alert" style="float:left;"></span>These items will be permanently deleted and cannot be recovered. Are you sure?</p>
            </div>            
            
            <br style="clear: both;" />
        </div>   
        <form action="<?php echo $this->here; ?>/permissoes/salvar" name="FORMULARIO" method="POST">
            <input type="hidden" name="opcao" value="Incluir" />
            <input type="hidden" name="_method" value="POST" />	
        <input type="hidden" name="data[id]" id="id" value="<?php echo $data->id; ?>"/>
        <?php
            if (isset ($success)){
                echo "<p>{$success}</p>";
            }
        ?>
        <p class="umacoluna">
            <label for="cadasUsuario">Grupo de permissão do usuario:</label>
            <select name="cadasUsuario">
                <option value="0">Usuario</option>
                <option value="1">Gestor</option>
                <option value="2">Administrador</option>
            </select>
            <br style="clear: left;" />
        </p>
        <p class ="botoes umacoluna">
            <input type="submit" value=" Incluir " />
            <input type="reset" value="Cancelar" />
            <br style="clear: left;" />
        </p>
        </form>
    </div>
</fieldset>

    
<script type="text/javascript" >
$(function() {

    $('#cidade').combobox();
    $('#categoria').combobox();
    $('#grupo').combobox();
    
//    $('#tags').tagit({tagSource: function( request, response ) {
//               $.ajax({
//					url: "<?php // echo $this->here; ?>/evento/buscacidade/" + request.term,
//                    dataType: "json",
//					success: function( data ) {
//						response( $.map( data, function( item ) {
//							return {
//                                value: "<span style='display: none;'>"+ item.uf + "</span>"+ item.nome,
//                                label: item.nome + " - " + item.uf
//							}
//						}));
//					}
//                    });
//                }, 
//                tagsChanged: function(valor, acao){
//                    if (acao == "added")
//                        $("#local_id").attr('value', valor);
//                    else
//                        $("#local_id").attr('value', '');
//                } }); 
                
    $.datepicker.setDefaults( $.datepicker.regional[ "pt-BR" ] );
	$('#datainicio, #datatermino').datepicker({ dateFormat: 'dd/mm/yy'});      
    
    $( "#dialog:ui-dialog" ).dialog( "destroy" );
    
    $('#atividadeexclui, #precoexclui').click(function(e){
        obj =  "#" + $(this).parents("form").attr("id") + ' input:checked + label';
        return confirm("Tem certeza quer excluir ?\n" + $(obj).text());
    });
    
    $( "#dialog-confirm" ).dialog({
        resizable: false,
        height:180,
        width : 250,
        autoOpen: false,
        modal: true,
        buttons: {
            "Delete all items": function() {
                $( this ).dialog( "close" );
                return true;
            },
            Cancel: function() {
                $( this ).dialog( "close" );
                return false;
            }
        }
    });
    
	
	});    
</script>

